import request from "@/utils/request";
import qs from "qs";

export function getAccountInfo() {
  return request({
    url: "/account/current",
    method: "get",
    data: {},
  });
}

export function fetchList(query) {
  return request({
    url: "/account/subList",
    method: "get",
    params: query,
  });
}

export function delObj(ids) {
  return request({
    url: "/account/delete",
    method: "delete",
    params: ids,
  });
}

export function saveObj(data) {
  return request({
    url: "/account/save",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
export function updateObj(data) {
  return request({
    url: "/account/edit",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: qs.stringify(data),
  });
}
export function getObj(id) {
  return request({
    url: "/account/get",
    method: "get",
    params: id,
  });
}

export function modifyPassword(obj) {
  return updateObj(obj);
}
